﻿@using Toolkit.Web
@using Toolkit.Web.ViewComponents
@using Toolkit.Web.ViewComponents.Notification
@using Toolkit.Web.Mvc
@using Toolkit.Web.Mvc.ViewComponents
@using Toolkit.Web.Mvc.ViewComponents.Notification

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section Title
{
    Notification
}

@section StyleSheetIncludes
{
    <link href="/Content/StyleSheets/Notification.css" rel="stylesheet" />
}


<div class="section">
    <h2>Error Type</h2>
    @(
        Html.Toolkit()
            .Notification(NotificationType.Error)
            .Title("Error")
            .AddMessage("This is the detailed message.")
    )
</div>
    
<div class="section">
    <h2>Warning Type</h2>
    @(
        Html.Toolkit()
            .Notification(NotificationType.Warning)
            .Title("Warning")
            .AddMessage("This is the detailed message.")
    )
</div>
    
<div class="section">
    <h2>Success Type</h2>
    @(
        Html.Toolkit()
            .Notification(NotificationType.Success)
            .Title("Success")
            .AddMessage("This is the detailed message.")
    )
</div>
    
<div class="section">
    <h2>Informative Type</h2>
    @(
        Html.Toolkit()
            .Notification(NotificationType.Informative)
            .Title("Information")
            .AddMessage("This is the detailed message.")
    )
</div>
    
<div class="section">
    <h2>Func Templating</h2>
    @(
        Html.Toolkit()
            .Notification(NotificationType.Informative)
            .Title(template => { return "Informative Notification"; })
            .AddMessage(@<text>
                Message <u>1</u>
            </text>)
            .AddMessage(template => "Message 2")
    )
</div>
    
<div class="section">
    <h2>Action Templating</h2>
    @(
        Html.Toolkit()
            .Notification(NotificationType.Informative)
            .Title((template, writer) => { writer.Write("Informative Notification"); })
            .AddMessage((template, writer) =>
            {
                writer.Write("Message 1");
            })
    )
</div>
    
<div class="section">
    <h2>No Title</h2>
    @(
        Html.Toolkit()
            .Notification(NotificationType.Informative)
            .AddMessage("Message 1")
            .AddMessage("Message 2")
    )
</div>
    
<div class="section">
    <h2>No Messages</h2>
    @(
        Html.Toolkit()
            .Notification(NotificationType.Informative)
            .Title("Informative Notification")
    )
</div>
    
<div class="section">
    <h2>Stacked Notifications</h2>
    @(
        Html.Toolkit()
            .Notification(NotificationType.Warning)
            .Title("Title")
            .AddMessage("This is the detailed message.")
    )
    @(
        Html.Toolkit()
            .Notification(NotificationType.Error)
            .Title("Title")
            .AddMessage("This is the detailed message.")
    )
</div>
    
<div class="section">
    <h2>Validation Errors</h2>
    @{
        ViewData.ModelState.AddModelError("key1", "Error for 'key1'");
        ViewData.ModelState.AddModelError("key3", "Error for 'key3'");
    }

    @Html.Toolkit().NotificationValidationMessage(ViewData, "key1", "key2", "key3").Title("Errors (1 and 3)")
</div>
